#include <algorithm>
#include <cstdio>
#include <cstring>

const int N = 105;
int s, d, m, p[N][N], f[10005];

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("testdata.in", "r", stdin);
  freopen("testdata.out", "w", stdout);
#endif
#ifndef LOCAL
  freopen("CppTest.in", "r", stdin);
  freopen("CppTest.out", "w", stdout);
#endif
#endif

  scanf("%d%d%d", &d, &s, &m);
  for (int i = 1; i <= d; ++i)
    for (int j = 1; j <= s; ++j) scanf("%d", &p[j][i]);
  for (int i = 2, tmp; i <= d; ++i) {
    memset(f, 0, sizeof(f));
    tmp = -1;
    for (int j = 1; j <= s; ++j) {
      for (int k = p[j][i - 1]; k <= m; ++k)
        f[k] = std::max(f[k], f[k - p[j][i - 1]] + p[j][i] - p[j][i - 1]),
        tmp = std::max(tmp, f[k]);
    }
    m += tmp;
  }
  printf("%d", m);
  return 0;
}